package Gameplay;

import java.awt.Rectangle;
import java.util.ArrayList;
import Gameplay.Enemy.*;
import Project.Constants;

import ADTs.PointADT;
/**
 * This class contains all the essential constants for each 
 * of the 27 levels.Such as adding new waves include different 
 * types of enemies with various positions. 
 * 
 * @author	Brian Wetherbee
 * 			Ryan McNamara
 * 			Zeng Yang
 *
 */
public class LevelConstants {
	
	
	//@ requires levelNum >= 0 && levelNum <= 26;
	//This method is to setup the waves with respect to the number of
	//the level.
	public static ArrayList<Wave> setUpWaves(int levelNum) {
		ArrayList<Wave> waves = new ArrayList<Wave>();
		
		if(levelNum == 0) {
			set1_1(waves);
		} else if(levelNum == 1) {
			set1_2(waves);
		} else if(levelNum == 2) {
			set1_3(waves);
		} else if(levelNum == 3) {
			set1_4(waves);
		} else if(levelNum == 4) {
			set2_1(waves);
		} else if(levelNum == 5) {
			set2_2(waves);
		} else if(levelNum == 6) {
			set2_3(waves);
		} else if(levelNum == 7) {
			set2_4(waves);
		} else if(levelNum == 8) {
			set3_1(waves);
		} else if(levelNum == 9) {
			set3_2(waves);
		} else if(levelNum == 10) {
			set3_3(waves);
		} else if(levelNum == 11) {
			set3_4(waves);
		} else if(levelNum == 12) {
			set4_1(waves);
		} else if(levelNum == 13) {
			set4_2(waves);
		} else if(levelNum == 14) {
			set4_3(waves);
		} else if(levelNum == 15) {
			set4_4(waves);
		} else if(levelNum == 16) {
			set5_1(waves);
		} else if(levelNum == 17) {
			set5_2(waves);
		} else if(levelNum == 18) {
			set5_3(waves);
		} else if(levelNum == 19) {
			set5_4(waves);
		} else if(levelNum == 20) {
			set6_1(waves);
		} else if(levelNum == 21) {
			set6_2(waves);
		} else if(levelNum == 22) {
			set6_3(waves);
		} else if(levelNum == 23) {
			set6_4(waves);
		} else if(levelNum == 24) {
			set7_1(waves);
		} else if(levelNum == 25) {
			set7_2(waves);
		} else if(levelNum == 26) {
			set7_3(waves);
		}
		
		return waves;
	}
	//@ ensures waves.size() > 0;
	//waves of first level 1-1
	public static void set1_1(ArrayList<Wave> waves) {
		//create a new wave
		Wave toAdd = new Wave((int)0);
		//add enemies
		toAdd.addEnemy(new Enemy1(new PointADT(300,300)));
		
		waves.add(toAdd);
		//create a new wave
		toAdd = new Wave((int)0);
		//add enemies
		toAdd.addEnemy(new Enemy1(new PointADT(300,300)));
		toAdd.addEnemy(new Enemy2(new PointADT(600,300)));
		toAdd.addEnemy(new Enemy1(new PointADT(900,300)));
		toAdd.addEnemy(new Enemy2(new PointADT(1200,300)));
		
		waves.add(toAdd);
	}

	//@ ensures waves.size() > 0;
	//waves of first level 1-2
	public static void set1_2(ArrayList<Wave> waves) {
		//create a new wave
		Wave toAdd = new Wave((int)0);
		//add enemies
		for(int index = 1; index <= 6; ++index) {
			PointADT point = new PointADT(150 * index, 150 * index);
			toAdd.addEnemy(new Enemy2(point));
		}
		
		
		waves.add(toAdd);

		//create a new wave
		toAdd = new Wave((int)0);
		//add enemies
		toAdd.addEnemy(new Enemy3(new PointADT(836,484)));
		waves.add(toAdd);
	}

	//@ ensures waves.size() > 0;
	//waves of first level 1-3
	public static void set1_3(ArrayList<Wave> waves) {

		Wave toAdd = new Wave((int)0);
		toAdd.addEnemy(new Enemy4(new PointADT(1400,Constants.height/4 * 0 + 1)));
		toAdd.addEnemy(new Enemy4(new PointADT(1400,Constants.height/4 * 1)));
		toAdd.addEnemy(new Enemy4(new PointADT(1400,Constants.height/4 * 2)));
		toAdd.addEnemy(new Enemy4(new PointADT(1400,Constants.height/4 * 3)));
		toAdd.addEnemy(new Enemy4(new PointADT(1400,Constants.height/4 * 4 - 1)));
		waves.add(toAdd);
		toAdd = new Wave((int)0);
		toAdd.addEnemy(new Enemy5(new PointADT(200,Constants.height/4 * 0 + 1)));
		toAdd.addEnemy(new Enemy5(new PointADT(200,Constants.height/4 * 1)));
		toAdd.addEnemy(new Enemy5(new PointADT(200,Constants.height/4 * 2)));
		toAdd.addEnemy(new Enemy5(new PointADT(200,Constants.height/4 * 3)));
		toAdd.addEnemy(new Enemy5(new PointADT(200,Constants.height/4 * 4 - 1)));
		waves.add(toAdd);
	}

	//@ ensures waves.size() > 0;
	//waves of first level 1-4
	public static void set1_4(ArrayList<Wave> waves) {
		// An IT level
		Wave toAdd = new Wave((int) 0);

		PointADT point = new PointADT(Constants.width + 70,
				Constants.height / 2);
		Enemy e = new Enemy1(point);
		e.movementBounds = new Rectangle(-100, 0, Constants.width + 300,
				Constants.height - Level.barHeight);
		toAdd.addEnemy(e);

		waves.add(toAdd);

		toAdd = new Wave((int) 0);
		for (int i = 0; i < 3; i++) {
			point = new PointADT(Constants.width + 70, (int) (Math.random() * (Constants.height - Level.barHeight)));
			e = new Enemy1(point);
			e.movementBounds = new Rectangle(-100,0,Constants.width + 300,Constants.height - Level.barHeight);
			toAdd.addEnemy(e);

		}

		waves.add(toAdd);
	}

	//@ ensures waves.size() > 0;
	//waves of first level 2-1
	public static void set2_1(ArrayList<Wave> waves) {
		Wave toAdd = new Wave((int)0);
		toAdd.addEnemy(new Enemy6(new PointADT(1300,Constants.height/2.0)));
		
		waves.add(toAdd);
	}

	//@ ensures waves.size() > 0;
	//waves of first level 2-2
	public static void set2_2(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 2-3
	public static void set2_3(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 2-4
	public static void set2_4(ArrayList<Wave> waves) {
		
	}
	
	//@ ensures waves.size() > 0;
	//waves of first level 3-1
	public static void set3_1(ArrayList<Wave> waves) {
		
	}
	
	//@ ensures waves.size() > 0;
	//waves of first level 3-2
	public static void set3_2(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 3-3
	public static void set3_3(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 3-4
	public static void set3_4(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 4-1
	public static void set4_1(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 4-2
	public static void set4_2(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 4-3
	public static void set4_3(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 4-4
	public static void set4_4(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 5-1
	public static void set5_1(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 5-2
	public static void set5_2(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 5-3
	public static void set5_3(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 5-4
	public static void set5_4(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 6-1
	public static void set6_1(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 6-2
	public static void set6_2(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 6-3
	public static void set6_3(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 6-4
	public static void set6_4(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 7-1
	public static void set7_1(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 7-2
	public static void set7_2(ArrayList<Wave> waves) {
		
	}

	//@ ensures waves.size() > 0;
	//waves of first level 7-3
	public static void set7_3(ArrayList<Wave> waves) {
		
	}
}
